// Login Form

$(function () {
    var button = $('#loginButton');
    var box = $('#loginBox');
    var form = $('#loginForm');
    button.removeAttr('href');
    button.mouseup(function (login) {
        box.toggle();
        button.toggleClass('active');
        $('#triangle3').toggle();
        $('#triangle4').toggle();
    });
    form.mouseup(function () {
        
        return false;
    });
    $(this).mouseup(function (login) {
        if (!($(login.target).parent('#loginButton').length > 0)) {
            button.removeClass('active');
            box.hide();
            $('#triangle3').hide();
            $('#triangle4').hide();
        }
    });

    var profileBox = $('#profileBox');
    var formProfile = $('.gbmpdv');

    formProfile.mouseup(function () {
        return false;
    });
    $(this).mouseup(function (profile) {

        if (!($(profile.target).parent('#profileBox').length > 0)) {

            $('#divProfile').hide();
            $('#triangle1').hide();
            $('#triangle2').hide();
        }
    });
});
